package com.ywl.designpattern.proxy;

import net.sf.cglib.proxy.Enhancer;

public class CglibProxyDemo {
    
    public static void main(String[] args) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(UserServiceImpl.class);
        enhancer.setCallback(new LogInterceptor());
        UserService proxy = (UserService) enhancer.create();
        proxy.addUser("Charlie");
    }
}
